function show(topic, v, type) {
	var self = this;
	this.v = v;
	this.map = {};
	this.number = 0;
	this.mimeCodec = 'video/webm;codecs=vp9,opus';
	this.readyBuffer = false;
	this.topic = topic;
	this.createMediaSource = function() {
		// 正常关闭页面后就停止播放
		self.mediaSource = new MediaSource();
		self.mediaSource.addEventListener('sourceopen', function(e) {
			self.sourceBuffer = self.mediaSource.addSourceBuffer(self.mimeCodec);
			var curMode = self.sourceBuffer.mode;
			if (curMode == 'segments') {
				self.sourceBuffer.mode = 'sequence';
			}
			self.sourceBuffer.addEventListener('updateend', self.updateend);
			self.readyBuffer = false;
		});
		self.v.src = URL.createObjectURL(self.mediaSource);
	}

	this.updateend = function() {
		delete self.map[number + ""];
		self.number++;
		if (self.map[self.number + ""] != undefined) {
			try {
				self.sourceBuffer.appendBuffer(self.map[self.number + ""]);
			} catch (e) {
				if(type == 'im'){
					websocket.send(topic + "-toCollection", JSON.stringify({ "command": "createMediaRecorder" }));
				}else{
					websocket.send(topic + "-toDisplay", JSON.stringify({ "command": "createMediaRecorder" }));
				}
			}
		} else {
			self.readyBuffer = false;
		}
	}

	this.interval = setInterval(function() {
		// 缓冲区存在数据时再进行获取
		if(self.v.buffered.length > 0) {
			var end = self.v.buffered.end(0);
			var curr = self.v.currentTime;
			if ((end - curr) > 1) {
				setTimeout(function() {
					self.v.currentTime = end;
				}, 30);
			}
		}
	}, 60);

	this.readMsg = function(msg) {
		// 字节消息（视频流）
		if (msg.isByte) {
			console.log(msg.headers.number);
			self.map[msg.headers.number] = msg.body;
			if (self.number == 0 && msg.headers.number != 0) {
				if(type=='im'){
					websocket.send(topic + "-toCollection", JSON.stringify({ "command": "createMediaRecorder" }));
				}else{
					websocket.send(topic + "-toDisplay", JSON.stringify({ "command": "createMediaRecorder" }));
				}
				return;
			}
			if (!self.readyBuffer) {
				self.number--;
				self.readyBuffer = true;
				self.updateend();
			}
		} else {
			var data = JSON.parse(msg.body);
			switch (data.command) {
				case "createMediaSource":
					self.map = {};
					self.number = 0;
					self.createMediaSource();
					break;
			}
		}
	}

	// 订阅目标的消息
	websocket.subscribe(topic + "-toShow", this.readMsg);
	websocket.subscribe(topic, self.readMsg);
	return this;
}
